package com.yjc.springcloud.alibaba.controller;

import com.yjc.springcloud.alibaba.domain.CommonResult;
import com.yjc.springcloud.alibaba.domain.Order;
import com.yjc.springcloud.alibaba.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shkstart
 * @create 2022-08-17 21:59
 */
@RestController
@Slf4j
public class OrderController {

    @Autowired
    OrderService orderService;

    @GetMapping("/consumer/order")
    public CommonResult<Order> order(Order order) {
        orderService.createOrder(order);
        return new CommonResult<>(200, "订单支付成功");
    }
}
